package cn.wolfcode.luowowo.member.domain;

import cn.wolfcode.luowowo.common.domain.BaseDomain;
import lombok.Getter;
import lombok.Setter;

@Getter
@Setter
//用户其他信息
public class UserMessage extends BaseDomain {
    //用户
    private UserInfo userInfo;

    //访客
    private String vistor;

    //访问量
    private int visitNum;

    //vip等级
    private int vip;


    /**
     * 访客用户Id
     * @return
     */
    public Long[] getVistorIds(){
        return resolve(vistor);
    }

    /**
     * 参数解析器
     */
    private Long[] resolve(String strIds){
        Long [] ids = null;
        if (strIds.length() > 0){
            String[] strs = strIds.split(",");
            ids = new Long[strs.length];
            for (int i = 0; i <strs.length ; i++) {
                ids[i] =  Long.parseLong(strs[i]);
            }
        }
        return ids;
    }
}
